<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="../utils/vue.js"></script>
	</head>
	<body>
		<div id="app">
			<cpn></cpn>
			<p>*****************************************</p>
			<cpn>
				<template slot-scope="slot">
					<button v-for="item in slot.data_props">{{item}}</button>
				</template>
			</cpn>
		</div>

		<template id="cpn">
			<div>
				<h1>作用域插槽的使用</h1>
				<slot :data_props="pLanguages">
					<li v-for="item in pLanguages">{{item}}</li>
				</slot>
			</div>
		</template>

		<script>
			new Vue({
				el: "#app",
				components: {
					cpn: {
						template: "#cpn",
						data() {
							return {
								pLanguages: ['javascript', 'java', 'c', 'c++', 'c#', 'android']
							}
						}
					}
				}
			})
		</script>
	</body>
</html>
